﻿using System;
using System.Collections.Generic;

namespace Bilibili.Model.Search
{
    public sealed class SearchArticleItem
    {
        public string mid { get; set; }
        private string _title;
        public string title
        {
            get => _title;
            set => _title = Uri.UnescapeDataString(value.Replace("<em class=\"keyword\">", string.Empty).Replace("</em>", string.Empty));
        }
        public string category_name { get; set; }
        public string type { get; set; }
        public string desc { get; set; }
        public int like { get; set; }
        public int view { get; set; }
        public int reply { get; set; }
        public string id { get; set; }
        public List<string> image_urls { get; set; }
        public string cover
        {
            get
            {
                if (image_urls != null && image_urls.Count != 0)
                    return "https:" + image_urls[0];
                return null;
            }
        }
    }
}